<?php

//require_once "Mail.php";
//require_once('class.phpmailer.php');


class template_model extends CI_Model {

    var $title;
    var $name;
    var $slogan;
    var $templatename;
    var $content;
    var $view;
    var $viewdata;
    var $contenttype;
    var $DBControle;

    function __construct($id = '', $name = '', $slogan = '', $templatename = 'default', $title = 'DDNS - Engelsoft', $contenttype = 'text') {
        parent::__construct();

        $this->id = $id;
        $this->name = $name;
        $this->slogan = $slogan;
        $this->templatename = $templatename;
        $this->title = $title;
        $this->contenttype = $contenttype;
    }

    public function gettitle() {
        return $this->title;
    }

    public function settitle($title) {
        $this->title = $title;
    }

    public function getname() {
        return $this->name;
    }

    public function setname($name) {
        $this->name = $name;
    }

    public function getslogan() {
        return $this->slogan;
    }

    public function setslogan($slogan) {
        $this->slogan = $slogan;
    }

    public function gettemplatename() {
        return $this->templatename;
    }

    public function settemplatename($templatename) {
        $this->templatename = $templatename;
    }

    public function getcontenttype() {
        return $this->content;
    }

    public function setcontettype($type) {
        $this->contenttype = $type;
    }

    public function getcontent() {
        return $this->content;
    }

    public function setcontent($templatename) {
        $this->content = $templatename;
    }

    public function getview() {
        return $this->view;
    }

    public function setview($view) {
        $this->view = $view;
        $this->setcontettype('view');
    }

    public function getviewdata() {
        return $this->viewdata;
    }

    public function setviewdata($viewdata) {
        $this->viewdata = $viewdata;
    }

    public function setcontetfromview($view, $dada) {

        $this->content = $templatename;
    }

    public function loadcontent() {
        if ($this->contenttype == 'text') {
            echo $this->content;
        } else {
            return $this->load->view($this->view, $this->viewdata, true);
        }
    }

    public function load() {
        include 'template/' . $this->gettemplatename() . '/index.php';
    }

}

?>
